<template>
<view class="page taskDetail">
    <view class="fcenter orderInfo">
        <!-- <text>订单剩余时间 23:59:30</text> -->
        <view class="money">￥<text class="amt">1.00</text></view>
        <text>中赫海豚湾素材下载金</text>
    </view>
    <view class="title2">支付方式</view>
    <view class="box payWay between">
        <view class="fcenter">
            <cdn-img src="/static/img/wechat.png" class="wechat"/>
            <text>微信支付</text>
        </view>
        <nut-checkbox v-model="checkbox"></nut-checkbox>
    </view>
    <view class="box notice">
        <view class="type">温馨提示：</view>
        <view>此费用为素材下载费用，一经支付不予退款！</view>
    </view>
    <view class="fixedBottom between">
        <view class="total">合计：<text class="amt">￥1.00</text></view>
        <view class="btn-blue4 bot fcenter" @click="openPayment">立即支付</view>
    </view>
</view>
</template>

<script setup>
import { ref } from 'vue'
import { useUserStore } from '@/stores'
import { showToast, requestPayment } from '@tarojs/taro'
import { navigateTo } from '@/router'
import { storeToRefs } from 'pinia';
import "./video.scss";

definePageConfig({
  navigationBarTitleText: '素材下载'
})
const user = useUserStore()
const { info, tiktok } = storeToRefs(user);
const checkbox = ref(true);

const goToSub = (url) => {
    navigateTo({ url: "/pagesub/"+url });
};

function openPayment(){
    if(!checkbox.value) return showToast({ title: '您还未选择支付方式', icon: 'none', duration: 3000})
    let res = {data:{}}
    requestPayment({
        ...res.data,
        success:(res)=> {
			// 支付成功开始下载
            console.log(333, res)
        },
        fail:(err)=> {
            console.log('fail:' + JSON.stringify(err));
        }
    });
}
</script>